Skip to content

Conversation

@labkey-jeckels
Copy link
Contributor

Rationale

We don't want to reset all HTTP headers when returning a 401 or other error page

Changes

  • Retain HTTP headers like CSP and Strict-Transport-Security
  • Minor code cleanup and Java 25 syntax


response.reset();

securityHeaders.forEach(response::setHeader);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this test response.isCommitted()? Will it throw if setHeader() is called late?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is all inside of if (!response.isCommitted()). See line 823, just outside the lines shown in the diff.

Copy link
Member

@labkey-tchad labkey-tchad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Manual test didn't turn up any problems and TeamCity seems happy.

@labkey-jeckels labkey-jeckels merged commit ff665a1 into develop Jan 23, 2026
13 checks passed
@labkey-jeckels labkey-jeckels deleted the fb_792_httpHeadersOnError branch January 23, 2026 23:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants